package model

import (
	"github.com/go-xorm/xorm"
	_ "github.com/go-sql-driver/mysql"
	"log"
)

var x *xorm.Engine

func init(){
	var xErr error
	x, xErr = xorm.NewEngine("mysql", "root:new_password@tcp(127.0.0.1:3306)/aesthetics_museum_package?charset=utf8")
	if xErr != nil {
		log.Fatal("数据库连接失败:", xErr)
	}
	if err := x.Sync(new(SetMeal), new(Customers), new(SupportingProject), new(RawMaterial)); err != nil {
		log.Fatal("数据表同步失败:", err)
	}
}